package com.atguigu.gmall.product.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/8/26 21:24
 */
@RestController
@RequestMapping("/admin/product")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/getCategory1")
    public Result GetCategory1() {
        return Result.ok(categoryService.getCategory1());
    }

    @GetMapping("/getCategory2/{category1Id}")
    public Result GetCategory2(@PathVariable("category1Id") Long category1Id) {
        return Result.ok(categoryService.getCategory2(category1Id));
    }

    @GetMapping("/getCategory3/{category2Id}")
    public Result GetCategory3(@PathVariable("category2Id") Long category2Id) {
        return Result.ok(categoryService.getCategory3(category2Id));
    }
    //attrInfoList/5/0/0
}
